<template>
    <div class="studentList">
        <div class="listContent">
            <div class="lableContent">
                <div style="width: 10%;">序号</div>
                <div style="width: 35%;">本班学生</div>
                <div style="width: 20%;">练习</div>
                <div style="width: 35%;">操作</div>
            </div>

            <div class="dataContent">
                <div class="dataItem" v-for="(item, index) in 10" :key="index">
                    <div style="width: 10%;">{{ index + 1 }}</div>
                    <div style="width: 35%;display: flex;align-items: center;cursor: pointer;" @click="handleStudentDetail">
                        <img src="@/static/image/avatar.jpg" alt="">
                        <div>妍与韩</div>
                        <div>（134****8877）</div>
                    </div>
                    <div style="width: 20%;">30/30</div>
                    <div style="width: 35%;display: flex; color: #3FB9E2;">
                        <div style="cursor: pointer;" @click="editVisible = true">编辑 </div>
                        <!-- <div style="margin: 0 20px;cursor: pointer;">批改作业 </div> -->
                        <div style="cursor: pointer;margin-left: 20px;">移除</div>
                    </div>

                </div>

            </div>

        </div>


        <div class="pageBox">
            <el-pagination @current-change="handleCurrentChange" background :current-page.sync="pageInfo.limit"
                :page-size="pageInfo.limit" layout="total, prev, pager, next" :total="pageInfo.total">
            </el-pagination>
        </div>


        <el-dialog :visible.sync="editVisible" center width="20%" :show-close="false">
            <div class="editBox">
                <div class="closeBox" @click="editVisible = false">
                    <i class="el-icon-close"></i>
                </div>
                <div class="title">
                    编辑学生
                </div>

                <div class="contentBox">
                    <div class="lable">
                        学生昵称：
                    </div>
                    <div class="value">
                        Aimee
                    </div>
                </div>
                <div class="contentBox">
                    <div class="lable">
                        学生备注：
                    </div>
                    <div class="value">
                        <el-input v-model="input" placeholder="请输入内容"></el-input>
                        <!-- <input class="inputitem" type="text" v-model="input" placeholder="请输入学生备注"> -->
                    </div>
                    <img src="@/static/image/edit01.png" alt="">
                </div>

                <div class="btnBox">
                    <div class="btn" @click="editVisible = false">
                        取消
                    </div>
                    <div class="btn btned">
                        确定
                    </div>
                </div>

            </div>
        </el-dialog>

    </div>
</template>
<script>
export default {
    data() {
        return {
            pageInfo: {
                page: 1,
                limit: 10,
                total: 100,
            },
            editVisible: false,
            input: "Aimee",
        }
    },
    methods: {
        handleStudentDetail() {
            this.$router.push({ name: "studentDetail" })

        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
            this.pageInfo.page = val
        },
    }
}
</script>

<style scoped lang="scss">
.studentList {
    width: 100%;
    height: 624px;
    background: #FFFFFF;
    border-radius: 4px 4px 4px 4px;
    margin-top: 16px;
    padding: 16px;
    box-sizing: border-box;
    position: relative;

    .listContent {
        .lableContent {
            display: flex;
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 12px;
            color: rgba(0, 0, 0, 0.4);
            line-height: 20px;
        }

        .dataContent {

            .dataItem {
                display: flex;
                align-items: center;
                height: 52px;
                background: #FFFFFF;
                border-top: 1px solid #E7E7E7;
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: rgba(0, 0, 0, 0.9);
                line-height: 20px;

                img {
                    width: 40px;
                    height: 40px;
                    border-radius: 40px;
                    margin-right: 10px;
                }
            }

            .dataItem:hover {
                background-color: #EAF9E8;
            }

        }
    }


    .pageBox {
        position: absolute;
        bottom: 5px;
        right: 60px;
    }

    .editBox {
        width: 377px;
        height: 254px;
        background: #FFFFFF;
        border-radius: 8px 8px 8px 8px;
        position: relative;

        .closeBox {
            position: absolute;
            right: 10px;
            top: 10px;
            color: #FFFFFF;
            cursor: pointer;
        }

        .title {
            width: 377px;
            height: 56px;
            background: #4BA840;
            border-radius: 8px 8px 0px 0px;
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            font-size: 16px;
            color: #FFFFFF;
            line-height: 56px;
            text-align: center;
            margin-bottom: 20px;
        }

        .contentBox {
            display: flex;
            align-items: center;
            width: 321px;
            height: 44px;
            border-bottom: 1px solid #EEEEEE;
            margin: 0 auto;

            .lable {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 12px;
                color: #777777;
                line-height: 14px;
            }

            .value {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 14px;
                color: #333333;
                line-height: 16px;

                .inputitem {
                    border: none;
                    outline: none;
                }
            }

            img {
                width: 24px;
                height: 24px;
            }
        }

        .btnBox {
            width: 100%;
            display: flex;
            justify-content: space-around;
            margin-top: 27px;

            .btn {
                width: 156px;
                height: 40px;
                background: #EFEFEF;
                border-radius: 4px 4px 4px 4px;
                font-family: PingFang SC, PingFang SC;
                font-weight: 500;
                font-size: 14px;
                color: #777777;
                line-height: 40px;
                text-align: center;
                cursor: pointer;
            }

            .btned {
                background: #4BA840;
                color: #ffffff;
            }
        }

    }

}


::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
    background-color: #4BA840;
}

::v-deep .el-pagination.is-background .el-pager li:hover {
    color: #ffffff;
    background-color: #4BA840;
}

::v-deep .el-dialog {
    background-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0);
}
</style>